import request from '@/utils/request'

// 分页查询
export const GetTeacherListByPage = (pageNum, pageSize, queryDto) => {
    return request({
        url: '/admin/school/teacher/findByPage/' + pageNum + '/' + pageSize,
        method: 'get',
        params: queryDto,
    })
}

export const FindAllTeacher = () => {
    return request({
        url: '/admin/school/teacher/findAllTeacher',
        method: 'get'
    })
}

export const FindTeacherByCourseId= courseId => {
    return request({
        url: '/admin/school/teacher/findTeacherByCourseId/' + courseId,
        method: 'get'
    })
}

export const GetAllTeacherByCollegeId = collegeId => {
    return request({
        url: '/admin/school/teacher/getAllTeacherByCollegeId/' + collegeId,
        method: 'get'
    })
}

// 新增教师的方法
export const SaveTeacher = data => {
    return request({
        url: '/admin/school/teacher/saveTeacher',
        method: 'post',
        data: data,
    })
}

// 修改教师数据的方法
export const UpdateTeacher = teacher => {
    return request({
        url: '/admin/school/teacher/updateTeacher',
        method: 'put',
        data: teacher,
    })
}

// 根据id删除教师
export const DeleteTeacherByTeacherNumber = teacherNpumber => {
    return request({
        url: '/admin/school/teacher/deleteTeacherByTeacherNumber/' + teacherNpumber,
        method: 'delete',
    })
}